<?

/*
insurgentes sur plaza inn
****************************************************************************
**                         CACTO ARTE E IDEAS                             **
**                       Ing. Omar Carpinteyro                            **
****************************************************************************

                 ** SISTEMA ADMINISTRADOR DE BANNERS **

*/

   require("../configuracion.php");
  $idSysSection = $sectionHerrBanners;
   //$path = "root";
   require("../application-top.php");

// CONNECT A LA DB

//require("../db.php");

// END CONNECT A LA DB

if (@$_GET['IDB']) {

$IDBAN = $_GET['IDB'];

if (@$_GET['confirmo'] == 10293) {

$DEADDATBanner = "DELETE FROM tbl_BannerPauta WHERE id_Banner = '$IDBAN'";
$result_00 = mssql_query($DEADDATBanner);

$DELViews    = "DELETE FROM tbl_BannerViews WHERE id_Banner = '$IDBAN'";
$result_01     = mssql_query($DELViews);

$DELClicks    = "DELETE FROM tbl_BannerClicks WHERE id_Banner = '$IDBAN'";
$result_02   = mssql_query($DELClicks);

$DAT        = "SELECT * from tbl_Banners WHERE id_Banner = '$IDBAN'";
$result     = mssql_query($DAT);
$inf        = mssql_fetch_array($result);


$DELFile = $inf['imagen_url'];
@unlink($DELFile);

$DEADbanner = "DELETE FROM tbl_Banners WHERE id_Banner = '$IDBAN'";
$result = mssql_query($DEADbanner);
?>
<script>
location = "banner_admin.php";
</script>
<?
//include("index.php");
exit();
}


$DAT        = "SELECT * from tbl_Banners WHERE id_Banner = '$IDBAN'";
$result     = mssql_query($DAT);
$inf        = mssql_fetch_array($result);



?>

<html>
 <head>
  <title><?= $instanciaECRM ?></title>
  <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
  <link rel="stylesheet" href="../styles/style.css" type="text/css">
  <script type="text/javascript" src="../scripts/dynlayer.js"></script>
 </head>
 <body leftmargin="0" class="mainBackground" topmargin="0" marginwidth="0" marginheight="0">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
   <tr><td><img src="../images/headerBar.gif" width="590" height="60" alt=""></td></tr>
   <tr>
    <td>
     <table width="800" border="0" cellspacing="0" cellpadding="0">
      <tr>
       <td bgcolor="#FFFFFF" valign="top" height="400">
        <table border="0" cellpadding="5" cellspacing="0" width="750">
         <tr>
          <td colspan="2">
           <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
             <td colspan="2"><img src="../images/spacer.gif" height="10" width="1" alt=""></td>
            </tr>
            <tr>
             <td><strong class="pageTitle">Banners</strong><br><strong class="pageSubtitle">Eliminar Banner</strong></td>
             <td align="right"><a href="http://www.cacto.com/" target="_blank"><img src="../images/trademarkCacto.gif" alt="Cacto" border="0"></a><br>
<strong class="systemTitle"><?= $instanciaECRM ?></strong><br>Perfil <strong><?= $PerfilUsuario ?></strong></td>
            </tr>
           </table>
          </td>
         </tr>
         <tr>
          <td colspan="2">
           <table border="0" cellpadding="5" cellspacing="1" class="mainTableBG">
            <tr class="answerCellBG">
             <td><img src="../images/icArrowGo.gif" height="13" width="13" alt=""></td>
             <td><a href="banner_admin.php">Regresar</a></td>
            </tr>
           </table>
          </td>
         </tr>
         <tr>
          <td valign="top">
           <table border="0" cellpadding="0" cellspacing="0">
            <tr>
             <td>
              <table border="0" cellpadding="5" cellspacing="1" class="mainTableBG">
               <tr>
                <td colspan="2" class="answerCellBG"><strong><font color="#FF0000">AVISO: Desea realmente eliminar el banner
                <?= $inf['nombre_banner']; ?></font>
                </strong></td>
               </tr>
              </table>
             </td>
            </tr>
            <tr>
             <td><img src="../images/spacer.gif" height="10" width="1" alt=""></td>
            </tr>
            <tr>
             <td>
              <table border="0" cellpadding="5" cellspacing="1" class="mainTableBG">
               <tr class="answerCellBG">
                <td><a href="banner_delete.php?IDB=<?= $IDBAN ?>&confirmo=10293">Eliminar</a></td>
               </tr>
              </table>
             </td>
            </tr>
            <tr>
             <td>
             </td>
            </tr>
           </table>
          </td>
         </tr>
        </table>
       </td>
      </tr>
     </table>
    </td>
   </tr>
  </table>
 <br>
<br>
<br>
<table width="750" border="0">
  <tr>
    <td align="right"><span class="copyright"><?= $copyright ?></span></td>
  </tr>
</table>
</body>
</html>

<?
}else{
	echo "<meta http-equiv='REFRESH' content='0;url=banner_admin.php'>";
	//include("banner_admin.php");
}
?>

